function [labels, values, count] = myStruct2Cell(in, count, labels, values)
    if nargin < 4, values = {}; end
    if nargin < 3, labels = {''}; end
    if nargin < 2, count = 0; end    
    if isstruct(in) && (count < 10)
        label = labels{end};
        for f = fieldnames(in)'
            f = f{:};
            count = count + 1;
            labels{end} = [label f ':'];
            [labels, values, count] = myStruct2Cell(in.(f), count, labels, values);            
        end
    elseif iscell(in) && (count < 10)        
        label = labels{end};
        in = reshape(in, 1, []);
        N = size(in, 2);
        for n=1:N
            count = count + 1;
            labels{end} = [label num2str(n) ':'];
            [labels, values, count] = myStruct2Cell(in{n}, count, labels, values);            
        end
    else
        if count >= 10
            values{end+1} = 'Sorry, branch too long!';
        else
            values{end+1} = in;
        end
        labels{end+1} = {''};
        count = 0;
    end
%    labels, values
end